<?php

/**
 * @author FedxTeam
 * @copyright 2013
 * Phan khung hien thi thong tin nguoi dung
 */
?>

<?php echo link_tag('css/home.css', 'stylesheet', 'text/css');?>
<?php echo link_tag('css/modal.css', 'stylesheet', 'text/css');?>

<div id="user_left">
    <div id="user_name">                 
        <h1 class="user-name"><?php echo $user['USERNAME']; ?></h1>
    </div>
    <div id="user_info">
        <ul>
            <li>
                <span class="title">
                    <div class="icon name-icon"></div>
                    Tên đầy đủ
                </span>
                <span class="data"><?php echo $user['FULLNAME']; ?></span>
            </li>
            <li>
                <span class="title">
                    <div class="icon name-icon"></div>
                    Tên đăng nhập
                </span>
                <span class="data"><?php echo $user['USERNAME']; ?></span>
            </li>
            <li>
                <span class="title">
                    <div class="icon name-icon"></div>
                    Học tại trường <?php echo $user['school_level'];?> 
                </span>
                <span class="data"><?php echo $user['school']; ?></span>
            </li>
            <li>
                <span class="title">
                    <div class="icon name-icon"></div>
                    Tham gia
                </span>
                <span class="data"><?php echo $user['create_date']; ?></span>
            </li>
            <li>
                <span class="title">
                    <div class="icon name-icon"></div>
                    Năm sinh
                </span>
                <span class="data"><?php echo $user['year_of_birth']; ?></span>
            </li>
            <li>
                <span class="title">
                    <div class="icon name-icon"></div>
                    Email
                </span>
                <span class="data"><?php echo $user['EMAIL']; ?></span>
            </li>
            <li>
                <span class="disc_link_left_menu">
                    <a href="#change_public_inf_frm" id="login_pop">Chọn thông tin hiển thị</a>
                </span>
                        
            </li>
            <li> 
                <span class="disc_link_left_menu">
                    <a href="#change_pass_frm" id="login_pop">Đổi mật khẩu</a>
                </span>
            </li>
            <li>
                <span class="disc_link_left_menu">
                    <a href="<?php echo base_url();?>user_controller/view_user_grade">Xem kết quả học tập</a>
                </span>
            </li>

            <!--
            <li>
                <span class="disc_link_left_menu">
                    <a href="#change_school_name_frm" id="login_pop">Sửa tên trường</a>
                </span>
            </li>
            -->
        </ul>         
    </div>

<a href="#x" class="overlay" id="change_public_inf_frm"></a>
<div class="popup">
    <form class="cmxform" id="change_public_inf_frm" method="post" name="change_public_inf_frm" action="<?php echo base_url();?>user_controller/change_public_inf/normal_user" onsubmit="1">
    <fieldset class="cpaner">
        <span class="show-info"><h2>Chọn thông tin hiển thị</h2></span>
        <table>
            <tr>
             <td class="name-info">   
                <label for="cpass" >Tên đầy đủ</label>
            </td>
            <td>
            <select name="allow_fullname">
                   <option value="2">Có</option>
                   <option value="1">Không</option>
            </select>
            </td>
        </tr>
        <tr>
            <td class="name-info">
                <label for="cpass" >Tên trường học</label>
            </td>
            <td>
                    <select name="allow_school_name">
                           <option value="2">Có</option>
                           <option value="1">Không</option>
                    </select>
            </td>
       </tr>   
       <tr>
           <td class="name-info">
                <label for="cpass">Năm sinh</label>
           </td>
           <td>
                <select name="allow_year_birth">
                       <option value="2">Có</option>
                       <option value="1">Không</option>
                </select>
           </td>
     </tr>
     <tr>
         <td class="name-info">
            <label for="cpass">Email</label>
         </td>
         <td>
            <select name="allow_email">    
                          <option value="2">Có</option>
                          <option value="1">Không</option>
                   </select>
         </td>
    </tr>
        </table>
        <p>
            <input class="submit" type="submit" value="Ghi nhận" />
        </p>
        
    </fieldset>
    </form>
</div>

<a href="#x" class="overlay" id="change_pass_frm"></a>
<div class="popup">
    <form class="cmxform" id="changePass" method="post" name="change_pass" action="<?php echo base_url();?>user_controller/change_pass/" onsubmit="return validateForm1()">
    <fieldset>
        <legend>Đổi mật khẩu</legend>
        <p>
            <label for="cpass">Mật khẩu cũ<em>*</em></label>
            <input type="password" id="cpass" name="old_pass" size="25"/>
        </p>
        <p>
            <label for="cpass">Mật khẩu mới<em>*</em></label>
            <input type="password" id="cpass" name="new_pass" size="25"/>
        </p>
        <p>
            <label for="cpass">Nhập lại mật khẩu mới<em>*</em></label>
            <input type="password" id="cpass" name="new_pass_check" size="25"/>
        </p>
        <p>
            <input class="submit" type="submit" value="Ghi nhận" />
        </p>
        
    </fieldset>
    </form>
</div>

<a href="#x" class="overlay" id="change_school_name_frm"></a>
<div class="popup">
    <form class="cmxform" id="changeSchoolName" method="post" name="change_school_name" action="<?php echo base_url();?>user_controller/change_school_name/" onsubmit="1">
    <fieldset>
        <legend>Sửa tên trường</legend>
        <p>
            <label for="cemail">Tên mới</label>
            <input id="cemail" name="new_school_name" size="25"/>
        </p>
        <p>
            <input class="submit" type="submit" value="Ghi nhận" />
        </p>
        
    </fieldset>
    </form>
</div>

<script>
    function validateForm()
    {
        var x=document.forms["change_pass"]["old_pass"].value;
        var y=document.forms["change_pass"]["new_pass"].value;
        var z=document.forms["change_pass"]["new_pass_check"].value;
        
        
        if(x == null || x == "")
        {
            alert("Bạn chưa nhập mật khẩu cũ");
            return false;
        }
        else
        {
            
        }
    }
</script>

